 <table class="datatable table table-striped table-hover" id="all_versions">
  <thead>
    <tr>
      <th class="hidden-xs">版本号</th>
      <th class="hidden-xs">应用名</th>
      <th class="hidden-xs">启动成功次数</th>
      <th class="hidden-xs">启动失败次数</th>
      <th class="hidden-xs">崩溃率</th>
      <th class="hidden-xs">类型</th>
      <th class="hidden-xs">来源</th>
      <th class="hidden-xs">迭代版本特点</th>
      <th class="hidden-xs">开发者</th>
      <th class="hidden-xs">发布日期</th>
      <th class="hidden-xs">操作</th>
    </tr>
  </thead>
  <tbody>
    <%  @app_versions.each do |app_version| %>
    <tr>
      <td class="hidden-xs"><%= app_version.version %></td>
      <td class="hidden-xs"><%= app_version.app.name %></td>
      <td class="hidden-xs"><%= app_version.success %></td>
      <td class="hidden-xs"><%= app_version.fails %></td>
      <td class="hidden-xs"><%= (((app_version.fails.to_f/(app_version.fails + app_version.success)).round(2))*100).to_i rescue '-' %></td>
      <td class="hidden-xs"><%= app_version.typehood %></td>
      <td class="hidden-xs"><%= app_version.source %></td>
      <td class="hidden-xs"><%= app_version.description %></td>
      <td class="hidden-xs"><%= User.find(app_version.dev_id).name rescue '-' %></td>
      <td class="hidden-xs"><%= app_version.released_date.strftime('%y-%m-%d') rescue '-' %></td>
      <td class="hidden-xs">
        <%= link_to '编辑', edit_version_path(app_version), class: "edit-btn btn btn-xs btn-warning", remote: true %>
        <% if current_user.is_admin? %>
            <%= link_to '删除', version_path(app_version), method: :delete, class: "del-btn btn btn-xs btn-danger" %>
        <% end %>
        </td>
    </tr>
    <% end %>
  </tbody>
  </table>
   <script>
  $('#all_versions').DataTable({
    stateSave: true
  });
  $(".del-btn").click(function(event) {
    if (!confirm("你确定吗？")) {
      event.preventDefault();
      event.stopPropagation();s
    }
  });
  </script>
